package com.pig.exception;
import com.pig.util.SysResult;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

@Slf4j
@RestControllerAdvice
public class GlobalExceptionHandler {
    @ExceptionHandler(ServiceException.class)
    public SysResult cacheException(Throwable e) {
        log.error("e.message {}",e.getMessage());
        return SysResult.fail(e);
    }
}
